<template>
	<div class="select-wrapper">
		<el-select v-model="productValue" placeholder="" @change="change">
			<el-option v-for="item in productLabel" :key="item.value" :label="item.label" :value="item.value">
			</el-option>
		</el-select>
	</div>
</template>

<script>
	export default {
		props: {
			productLabel: {
				type: Array,
				default: false
			}
		},
		data() {
			return {
				productValue:'0'
			}
		},
		methods:{
			change(value) {
				for (let i=0;i<this.productLabel.length;i++) {
					if(value == this.productLabel[i].value){
						//console.log(this.productLabel[i].label)
						this.$emit('selectValue',this.productLabel[i].label,this.productLabel[i].type)
					}
				}
			}
		},
		mounted() {
//			console.log(this.product);
//			console.log(this.product[this.productValue].label)
		}
	}
</script>

<style scoped="scoped">

</style>